package com.it.web.controller;

import com.it.domain.Account;
import com.it.service.AccountService;
import com.it.web.commons.ResultInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/*
账户的控制器
 */
@RestController
@RequestMapping("/account")
public class AcountController {

    @Autowired
    private AccountService accountService;

    //查询所有工作
    @RequestMapping("/findAll")
    public ResultInfo findAll(){
        System.out.println("控制器查询所有帐户");
        List<Account> accounts=accountService.findAll();
        return new ResultInfo(200,"执行成功",accounts);

    }
}
